Thermal conductivity of uranium dioxide (UO2) is an important nuclear fuel performance property. Radiation- and fission-induced defects and microstructures, such as xenon (Xe) gas bubbles, can degrade the thermal conductivity of UO2 significantly. Here, molecular dynamics simulations are conducted to study the effect of Xe bubble size and pressure on the thermal conductivity of UO2. At a given porosity, thermal conductivity increases with Xe cluster size, then reaches a nearly saturated value at a cluster radius of 0.6 nm, demonstrating that dispersed Xe atoms result in a lower thermal conductivity than clustering them into bubbles. In comparison with empty voids of the same size, Xe-filled bubbles lead to a lower thermal conductivity when the number ratio of Xe atoms to uranium vacancies (Xe:VU ratio) in bubbles is high. Detailed atomic-level analysis shows that the pressure-induced distortion of atoms at bubble surface causes additional phonon scattering and thus further reduces the thermal conductivity.